var bShowLeft = false;
/**
 * get an cookie from the user machine
 */
function __cookieGet($name) {
  var arg = $name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0)
      break;
  }
  return null;

  function getVal(offset) {
    var endstr = document.cookie.indexOf (";", offset);
    if (endstr == -1)
      endstr = document.cookie.length;
    return unescape(document.cookie.substring(offset, endstr));
  }
}
    
function TocMenu() {
	var _srcCols = null;
	var _domFsBottom = null;

	/** 初始化 */
	this.init = function init() {
		_domFsBottom = document.getElementById("framesetBottom");
		_srcCols = "188,*";
	};

	/** 修改左边菜单的显示效果，如果为显示就隐藏，否则显示 */
	this.changeVision = function() {
        if (_domFsBottom==null) {
          init();
        }    
        
        if (_domFsBottom.getAttribute("cols")==_srcCols) {
			_domFsBottom.setAttribute("cols", "7,*");
            //top.setMenuStatus(true);
            return true;
		}else {
			_domFsBottom.setAttribute("cols", _srcCols);
            //top.setMenuStatus(false);
            return false;
		}
	};

    this.changeToSmall = function() {
        if (bShowLeft) {
	        if (_domFsBottom==null) {
	          setTimeout(init, 5000);
	          return;
	        }
	        _domFsBottom.setAttribute("cols", "7,*");
	        top.setMenuStatus(true);
	        window.leftArea.hide();
        }
        return true;
    };
    
    this.changeToBig = function() {
      if (bShowLeft) {
	      if (_domFsBottom==null) {
	          setTimeout(init, 5000);
	          return;
	      }
	      _domFsBottom.setAttribute("cols", _srcCols);
	      window.leftArea.show();
      }
      top.setMenuStatus(false);      
    };    
}
var _tocMenu = new TocMenu();

var _bPin = __cookieGet("oa_pin");
if (_bPin==null) {
  _bPin = false; //默认为固定
}else {
  _bPin = _bPin==1?true:false;
}